IShPrefsComponent Struct Reference
[COM Interfaces]

Inheritance diagram for IShPrefsComponent:

IMCUnknown List of all members.

Public Member Functions

virtual IShParameterComponent
*MCCOMAPI 
GetThisParameterComponent ()=0
virtual TMCCommandBindingContextList
*MCCOMAPI 
GetCommandBindingContexts ()=0

Detailed Description

IShPrefsComponent is a component used to store the preferences of another component. It can also store user defined key bindings Those preferences are stored on a per user basis. So far there is no "explicit" UI in Carrara to change the component's preferences, but this mechanism can be used for example to save the position of a component's toolbar (eg motion path in Carrara).

To implement a prefs component:

Now for the component that wants to store its preferences, declare a 'CINF' resource and put the ID of the prefs component in its fPrefsCompID field. Example:

    resource 'CINF' (R_PathAnimationMethod, "Motion Path")
    {
        'path',
        kAnyPlatform,
        kAnyAppKind,
        kAnyAppMode, 
    };
    

Now in the code of component that wants to access its preferences, you can call GetMyPrefsComponent (implemented by TBasicDataExchanger). Example:

    IShParameterComponent* myPrefsComp= GetMyPrefsComponent();
        if (MCVerify(myPrefsComp))
        {
                TMCPoint tbPos= kDefaultMPToolbarPos;
                myPrefsComp->GetParameter(kToolBarParamID, &tbPos);
                //...
        }

See also:
IShComponent::GetPrefComponent


Member Function Documentation

virtual TMCCommandBindingContextList* MCCOMAPI IShPrefsComponent::GetCommandBindingContexts (   )  [pure virtual]
 

Returns the binding contexts of the external component

virtual IShParameterComponent* MCCOMAPI IShPrefsComponent::GetThisParameterComponent (   )  [pure virtual]
 

IShPrefsComponent is always an IShParameterComponent


The documentation for this struct was generated from the following file:
Generated on Wed Dec 7 14:27:40 2005 for Carrara SDK Doc by  doxygen 1.4.5